#include "ros/ros.h"
#include "std_msgs/Int32.h"

using namespace std;

void cmd_cb(const std_msgs::Int32 &msg)
{
    int command_;
    command_ = msg.data;
	cout << "receive command: " << command_ << endl;
}

int main(int argc, char **argv)
{
    ros::init(argc,argv,"sync_command_node");
    ros::NodeHandle nh("~");
    ros::Subscriber cmd_sub = nh.subscribe("/sync_command",10,cmd_cb);
    cout << "waiting for sync_command"<< endl;
    ros::spin();
    return 0;
}